<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/templates/common/taglib.jsp"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
       <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <title>${title }</title>
    <link rel="stylesheet" href="${basePath}/static/bootstrap/css/bootstrap.css"/>
    <link href="${basePath}/static/css/basic.css" rel="stylesheet" type="text/css">
    <link href="${basePath}/static/css/login.css" rel="stylesheet" type="text/css">
    <link href="${basePath}/static/css/list.css" rel="stylesheet" type="text/css">
    <script  type="text/javascript" src="${basePath}/static/js/jquery.min.js"></script>
	<script  type="text/javascript" src="${basePath}/static/My97DatePicker/WdatePicker.js"></script>
	<script type="text/javascript" src="${basePath}/static/page/jqPaginator/jqPaginator.js"></script>
    <style>
     .td_input_box{
        width: 95%;
	    height: 28px;
	    text-align: left;
	    text-indent: 5px;
	    line-height: 20px;
	    border-bottom: #fec99c solid 1px;
	    border-top: #FFF solid 1px;
	    border-left: #FFF solid 1px;
	    border-right: #FFF solid 1px;
     }
     .btn{
      background: #039b8e;
      color:#fff;
     }
     .td_relative{
      position:relative;
      }
     .checkList{
      display:none;
      position:absolute;
      top:35px;
      left:10px;
      border:1px solid #ccc;
      width:95%;
      height:150px;
      overflow-y:scroll;
     }
     .checkList li{
      width:100%;
      height:auto;
      line-height:30px;
      padding:0 5px;
      text-align:left;
     }
     .checkList li:hover{
      background-color:#EAF4F6;
     }
     .int {
	    background: #07a396;
	    color: #FFF;
	    border-radius: 4px;
	    cursor: pointer;
	    padding: 4px;
	}
    </style>
</head>
<body>
<!--头部-->
	<%@include file="/WEB-INF/templates/common/header.jsp"%>
	<!------导航条-->
	<%@include file="/WEB-INF/templates/common/navigation.jsp"%>

<!--内容部分-->
<div class="list_main lay_out" class="clearfix">
    <div class="list_DH">
        <%@include file="/WEB-INF/templates/common/indexPageAudit.jsp"%>
    </div>
    <div class="list_NR">
        <div class="loc">
            <h3 style="margin:0">病案返修查询</h3>
        </div>
        <div class="list_con_table" style="overflow:visible">
        
        	 <div class="search_table">
                <ul class="clearfix" style="margin-bottom:0;border-bottom:#e3e5e4 1px solid">
				    <li class="Label_1">病案号：&nbsp;</li>
				    <li class="Label_2">${firstLevelMedical.onlyId}</li>
				    <li class="Label_1">识别码：&nbsp;</li>
				    <li class="Label_2">${firstLevelMedical.mrId}</li>
				    <li class="Label_1">姓名：&nbsp;</li>
				    <li class="Label_2">${firstLevelMedical.name}</li>
				    <li class="Label_1">身份证号：&nbsp;</li>
				    <li class="Label_2">${firstLevelMedical.idCard}</li>
				    <li class="Label_1">出院日期：&nbsp;</li>
				    <li class="Label_2">${firstLevelMedical.outHospitalDate}</li>
				    <li class="Label_1">出院科室：&nbsp;</li>
				    <li class="Label_2">${firstLevelMedical.officeName}</li>
				    <!-- <li class="Label_5">
				     <a onclick="save()">保存</a><a onclick="add()">新增</a>
				    </li> -->
				  </ul>
				  <table class="Search_tableList">
				       <tr>
                                <td class="tdLabel_4" width="50%">审核内容</td>
                                <td class="tdLabel_4" width="30%">审核时间</td>
                                <td class="tdLabel_4" width="20%">操作</td>
                         </tr>  
                        <tbody id="tbody">
                          
                            <tr>
                                <!-- <td class="tdLabel_5 td_relative">
                                	
                                </td>
                                <td class="tdLabel_5">
                                    
                                </td>
                                <td class="tdLabel_5">
                                 <a class="int" onclick="scan()">首页</a>
                                 <a class="int" onclick="edit(event)">修改</a>
                                </td> -->
                             </tr>
                        </tbody>
                    </table>
   			</div>   
        </div> 	
    </div>
</div>
<input type="hidden" id="firstGuid" value="${firstLevelMedical.firstGuid}">
<!------页脚部分--------->
<%@include file="/WEB-INF/templates/common/footer.jsp"%>

<!--JS部分-->
<script type="text/javascript">
   var firstGuid=$("#firstGuid").val();
  
   $.ajax({
   	type:"get",
   	data:{firstGuid:firstGuid},
   	url:"${basePath}/medRecordAuditDetail/findAuditRecordDetailList",
   	success:function(data){
   		console.log(data)
   		
   		var auditRecordDetailList=data.auditRecordDetailList;
   		if(auditRecordDetailList.length>0){
   			var html="";
   			for(var i=0;i<auditRecordDetailList.length;i++){
   				var statushtml="修改";
   				if(auditRecordDetailList[i].status==1){
   					statushtml="修改";
   				}else{
   					statushtml="已修改";
   				}
   				html+='<tr data-id='+auditRecordDetailList[i].id+' data-auditingStandardId='+auditRecordDetailList[i].auditingStandardId+'><td class="tdLabel_5 td_relative remark">'+auditRecordDetailList[i].remark+'</td>'
                          +'<td class="tdLabel_5 createTime">'+auditRecordDetailList[i].createTime+'</td>'
                          +'<td class="tdLabel_5">'
                          +'<a class="int" style="margin:0 2px;" onclick="scan()">首页</a>'
                          +'<a class="int" style="margin:0 2px;" onclick="edit(this)">'+statushtml+'</a>'
                          +'</td></tr>';
   			}
   			$("#tbody").html("").html(html);
   		}else{
   			layer.alert("暂无缺陷数据!",{icon:2})
   		}
   	}
   })
   //首页按钮
   function scan(){
	   window.open('${corePath}/medrecord/medrecordHomePageManage?firstGuid='+firstGuid); 
   }
   
   //修改按钮
   function edit(event){
	   var target=$(event);
	   var id=target.closest("tr").attr("data-id");
	   $.ajax({
		   type:"post",
		   url:"${basePath}/medRecordAuditDetail/updateStatusById",
		   data:{id:id},
		   dataType:"json",
		   success:function(data){
			/*   console.log(data) */
			if(data.success){
				target.html("已修改");
			}else{
			  layer.alert("系统繁忙，请刷新重试!",{icon:2})	
			}
		   }
	   })
   }
   
</script>

</body>
</html>